/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task10.task1012;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/* 
字母数
*/

public class Solution {

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        // 字母
        String abc = "abcdefghijklmnopqrstuvwxyz";
        char[] abcArray = abc.toCharArray();

        ArrayList<Character> alphabet = new ArrayList<>();
        for (char letter : abcArray) {
            alphabet.add(letter);
        }

        // 读取字符串
        ArrayList<String> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            String s = reader.readLine();
            list.add(s.toLowerCase());
        }

        // 在此编写你的代码
        int[] temp = new int[26];
        HashMap<Character, Integer> characterIntegerHashMap = new HashMap<>();
        for (int i = 0; i < temp.length; i++) {
            characterIntegerHashMap.put(abcArray[i], temp[i]);
        }

        /*循环链表*/
        for (int i = 0; i < list.size(); i++) {

            String string = list.get(i);
            /*循环string字符串*/
            for (int j = 0; j < string.length(); j++) {

                char c = string.charAt(j);
                if (characterIntegerHashMap.containsKey(c)) {
                    Integer count = characterIntegerHashMap.get(c);
                    characterIntegerHashMap.put(c, count + 1);
                }

            }

        }

        for (Map.Entry<Character, Integer> item : characterIntegerHashMap.entrySet()) {
            System.out.println(item.getKey() + " " + item.getValue());
        }


    }
}
